/**
 * 网站所有幻灯片
 */

if(location.href=="http://czt.jl.gov.cn/" || location.href=="http://czt.jl.gov.cn/index.html"){
//首页

	
	_EsdDynamicTransformationScript.slidePointIntervalsf = setInterval(function () {
		if ( $("#slideBox .bd ul li:eq(3) span a")[0] != undefined 
				&& $("#slideBox .bd ul li:eq(2) span a")[0] != undefined 
				&& $("#slideBox .hd ul li:eq(3)")[0] != undefined 
				&& $("#slideBox .hd ul li:eq(0)")[0] != undefined ) {
			clearInterval(_EsdDynamicTransformationScript.slidePointIntervalsf);
	
	//轮播,右下角原点--鼠标移动触发情况

	//轮播：只获取轮播中一个a标签。
	//以文字a标签为主，图片a标签尽量不要，title不稳定

	//轮播前的标签
	  _EsdDynamicTransformationScript.esdTagFrontNum1 = $("#keyword").parent().next().find("input");

	//文字A标签
	  _EsdDynamicTransformationScript.esdTagANum1 = $("#slideBox .bd ul li:eq(0) span a");
	  _EsdDynamicTransformationScript.esdTagANum2 = $("#slideBox .bd ul li:eq(1) span a");
	  _EsdDynamicTransformationScript.esdTagANum3 = $("#slideBox .bd ul li:eq(2) span a");
	  _EsdDynamicTransformationScript.esdTagANum4 = $("#slideBox .bd ul li:eq(3) span a");

	//原点
	  _EsdDynamicTransformationScript.esdTagCircleNum1 = $("#slideBox .hd ul li:eq(0)");
	  _EsdDynamicTransformationScript.esdTagCircleNum2 = $("#slideBox .hd ul li:eq(1)");
	  _EsdDynamicTransformationScript.esdTagCircleNum3 = $("#slideBox .hd ul li:eq(2)");
	  _EsdDynamicTransformationScript.esdTagCircleNum4 = $("#slideBox .hd ul li:eq(3)");

	//轮播后的标签
//	  _EsdDynamicTransformationScript.esdTagAfterNum1 = $(".bor #slideBox").parent().next().find("a:first");


		//轮播前的焦点
		_EsdDynamicTransformationScript.esdTagFrontNum1.focus(function (e) {
			$(document).bind("keydown.keydown_0", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					$(document).unbind("keydown.keydown_0");
					$("#keyword").focus();
					return false;
				}else if (e.keyCode == 9) {
//					console.log( _EsdDynamicTransformationScript.esdTagCircleNum1.html() );
//					console.log( _EsdDynamicTransformationScript.esdTagANum1.html() );
					
					$(document).unbind("keydown.keydown_0");
					_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
					_EsdDynamicTransformationScript.esdTagANum1.focus();
					console.log(document.activeElement);
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.esdTagFrontNum1.blur(function () {
			$(document).unbind("keydown.keydown_0");
		});
		
		

		//第一块
		_EsdDynamicTransformationScript.esdTagANum1.focus(function (e) {
//			_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
			$(document).bind("keydown.keydown_1", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					$(document).unbind("keydown.keydown_1");
					$("#keyword").parent().next().find("input").focus();
					return false;
				}else if (e.keyCode == 9) {
//					console.log( _EsdDynamicTransformationScript.esdTagCircleNum2.html() );
//					console.log( _EsdDynamicTransformationScript.esdTagANum2.html() );
					
					$(document).unbind("keydown.keydown_1");
					_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
					_EsdDynamicTransformationScript.esdTagANum2.focus();
					console.log(document.activeElement);
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.esdTagANum1.blur(function () {
			$(document).unbind("keydown.keydown_1");
		});

		//第二块
		_EsdDynamicTransformationScript.esdTagANum2.focus(function (e) {
			
//			_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
			$(document).bind("keydown.keydown_2", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					_EsdDynamicTransformationScript.esdTagCircleNum1.mouseover();
					_EsdDynamicTransformationScript.esdTagANum1.focus();
					return false;
				}else if (e.keyCode == 9) {
					_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
					_EsdDynamicTransformationScript.esdTagANum3.focus();
					console.log(document.activeElement);
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.esdTagANum2.blur(function () {
			$(document).unbind("keydown.keydown_2");
		});
		
		//第三块
		_EsdDynamicTransformationScript.esdTagANum3.focus(function (e) {
			
//			_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
			$(document).bind("keydown.keydown_3", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					_EsdDynamicTransformationScript.esdTagCircleNum2.mouseover();
					_EsdDynamicTransformationScript.esdTagANum2.focus();
					return false;
				}else if (e.keyCode == 9) {
					_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
					_EsdDynamicTransformationScript.esdTagANum4.focus();
					console.log(document.activeElement);
					return false;
				}
			});
		});
		_EsdDynamicTransformationScript.esdTagANum3.blur(function () {
			$(document).unbind("keydown.keydown_3");
		});
		
		//第四块
		_EsdDynamicTransformationScript.esdTagANum4.focus(function (e) {
//			_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
			$(document).bind("keydown.keydown_4", function (e) {
				if(e.shiftKey&&e.keyCode==9){
					_EsdDynamicTransformationScript.esdTagCircleNum3.mouseover();
					_EsdDynamicTransformationScript.esdTagANum3.focus();
					return false;
				}else if (e.keyCode == 9) {
//					_EsdDynamicTransformationScript.esdTagAfterNum1.focus();
//					return false;
				}
			});

		});
		_EsdDynamicTransformationScript.esdTagANum4.blur(function () {
			$(document).unbind("keydown.keydown_4");
		});
		
//		//轮播后的焦点
//		_EsdDynamicTransformationScript.esdTagAfterNum1.focus(function (e) {
//			
//			$(document).bind("keydown.keydown_5", function (e) {
//				if(e.shiftKey&&e.keyCode==9){
//					_EsdDynamicTransformationScript.esdTagCircleNum4.mouseover();
//					_EsdDynamicTransformationScript.esdTagANum4.focus();
//					return false;
//				}
////				else if (e.keyCode == 9) {
////					
////					return true;
////				}
//			});
//
//		});
//		_EsdDynamicTransformationScript.esdTagAfterNum1.blur(function () {
//			$(document).unbind("keydown.keydown_5");
//		});

		}
	}, 500);

}



